package si.dejan.picflip.controller.commands
{
	import flash.system.Capabilities;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import si.dejan.picflip.model.BackgroundProxy;
	import si.dejan.picflip.model.SearchProxy;
	import si.dejan.picflip.views.BackgroundMediator;
	import si.dejan.picflip.views.SearchBoxMediator;
	
	public class Startup extends SimpleCommand implements ICommand
	{
		override public function execute(notification:INotification):void
		{
			var app:main = notification.getBody() as main;
			app.width = Capabilities.screenResolutionX;
			app.height = Capabilities.screenResolutionY;
			
			facade.registerProxy(new SearchProxy("4c4756dd7aa1e36cf66c1b1da21feebb"));
			facade.registerProxy(new BackgroundProxy());
			
			facade.registerMediator(new SearchBoxMediator(app.searchBox));
			facade.registerMediator(new BackgroundMediator(app.bg));
		}
	}
}